<include file="Public:header" />
<div class="subnav">
  <div class="explain-col" style="position: relative;">
  在此发布的建议/投诉只有超级管理员才能查看
  </div>
</div>

<div class="pad-lr-10">
  <div class="table-list">
    <table width="100%" cellspacing="0">
      <volist name="list" id="vo">
        <thead>
          <tr>
            <th width="30" align="left">序号</th>
            <th width="160" align="left" >标题</th>
            <th align="left">内容</th>
            <th align="center">时间</th>
          </tr>
        </thead>
        <tbody  id="list">
            <tr id="list-{$vo.id}">
              <td align="center">{$i}</td>
              <td align="left">{$vo.title}</td>
              <td align="left">{$vo.content}</td>
              <td align="center">{$vo.create_time|date='Y-m-d H:i:s',###}</td>
            </tr>
        </tbody>
      </volist>
    </table>
  </div>
  <div class="btn">
    <div id="pages" style="float:left;">{$page}</div>
    <!--<input name="submit" type="button" class="button" value="导出联系人信息"  onclick="return exportExcel();">-->
  </div>
</div>

<form name="myform" id="myform" method="POST" action="__CONTROLLER__/add">
  <fieldset>
    <legend>建议/投诉</legend>
    <table class="table_form" width="100%" cellspacing="0">
      <tbody>
        <tr>
          <th>标题：</th>
          <td><input name="title" type="text" class="input-text hideborder" id="title" size="20"  value="" style="width:280px;" /></td>
        </tr>
        <tr class="last">
          <th>内容：</th>
          <td><textarea name="content" id="editor" style="height: 80px; width: 650px;"></textarea></td>
        </tr>
        <tr>
          <th width="100"></th>
          <td>
            <INPUT class=button value=提交 type=submit name=dosubmit>
          </td>
        </tr>
      </tbody>
    </table>
  </fieldset>
  <input type="submit" value="提交" class="dialog" id="dosubmit">
</form>
<eq name="_SESSION['user_id']" value="1">
<div class="btn">
    <a href="__URL__/feedbacklist" class="button">建议/投诉 管理</a>
</div>
</eq>
</body>
</html>
<script type="text/javascript" src="/Public/Js/ueditor/ueditor.config.js"></script> <!--ueditor编辑器-->
<script type="text/javascript" src="/Public/Js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function(){
  $('#myform').ajaxForm({
    beforeSubmit:  checkForm,
    success:       complete,
    dataType: 'json'
  });
  function checkForm(){
    var title  = $('#title').val();
    var content  = $('#editor').val();
    if(title == ''){
      msg('标题不能为空',0);
      $('#title').focus();
      return false;
    }
    if(content == ''){
      msg('内容不能为空',0);
      $('#editor').focus();
      return false;
    }
    return true;
  }
  function complete(data){
    msg(data.info,data.status);
    if(data.status==1){
      $('#title').val('');
      $('#editor').val('');
      setTimeout(function(){location.reload();},500);
    }
  }

})
</script>
<script type="text/javascript">
    //实例化编辑器
    UE.getEditor('editor',{
        //清空了工具栏
        toolbars:[['fullscreen',  'source', '|', 'emotion','undo', 'redo', '|',
            'bold', 'italic', 'underline',
            'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|',
            'link', 'unlink',  '|',
            'help', 'drafts']]
    })
</script>